﻿@{
    ViewBag.Title = "EditHangBan";
    Layout = "~/Views/Shared/_Admin_Layout.cshtml";
}
@model CoffeeBar.Models.HangBan
<h1 style="width:80%; height:auto; margin: 5px auto; text-align:center;">---SỬA HÀNG BÁN---</h1>
@if (ViewData["result"] != null)
    {
        <h3>@ViewData["result"] </h3>
    }
        
        <style>
            div#edit-item p
            {
                font-size:15px;
            }
        </style>
<div id="edit-item">
@if (ViewData["model"] != null)
{
    var item = ViewData["model"] as CoffeeBar.Models.HangBan;
    
   <form action="EditHangBan" method="post">
   <input type="hidden" name="mahang" value="@item.MaHang" />
        <p>Tên Hàng: 
        <input type="text" name="tenhang" value="@item.TenHang" />
        ---  Thuộc Loại : 
        <select name="loaihangban">
        <option value="-1">---Chọn---</option>
            @if (ViewData["dsLoaiHang"] != null)
            {
                var items = ViewData["dsLoaiHang"] as List<CoffeeBar.Models.LoaiMatHang.LoaiHang>;
                foreach (var it in items)
                {
                    string selected="selected=selected";
                    <option value="@it.maloaihang" @if ((Convert.ToInt32(it.maloaihang)) == item.MaLoaihang) { @selected.ToString() } >@it.tenloaihang</option>
                }
            }
     </select>
        </p>
        <p>Đơn Giá: 
        <input type="text" name="dongia" value="@item.DonGia" />  ---
       Tình Trạng Sẵn Có: 
      <select name="sanco">
      @if (item.SanCo > 0)
      {
            <option value="11" selected="selected">Sẵn Có</option>
            <option value="-11">Không Sẵn Có</option>
      }
      else
      {
          <option value="11" >Sẵn Có</option>
            <option value="-11" selected="selected">Không Sẵn Có</option>
      }
  
    </select>
    </p>
    <p>Điểm Đánh Giá Từ Khách Hàng  :  @item.DiemDanhGia <input type=hidden name="diemdanhgia" value="@item.DiemDanhGia"</p>
        <script type="text/javascript" src="../../Scripts/ckeditor/ckeditor.js" language="javascript"></script>
             <script type="text/javascript" language="javascript">
        window.onload = function () {
            CKEDITOR.replace('txtgioithieu');
            }
        </script> 
        <p>Giới Thiệu: 
       <textarea id="txtgioithieu" name="txtgioithieu" rows="10" cols="40" >@item.GioiThieu</textarea>
        </p>        
    <input type="submit" name="editsubmit" value=" Thay Đổi " />
    </form>
}    
</div>
<h2>@Html.ActionLink("Quay Lại Trang Xem HÀNG BÁN", "XemHangBan")</h2>